package com.itheima.service;

import com.itheima.dao.StudentDao;
import com.itheima.domain.Student;

import java.util.List;

//业务层
public class StudentService {

    //调用dao  查询数据库
    public List queryAll() {
        StudentDao studentDao = new StudentDao();
        return studentDao.findAll();
    }

    //添加学生
    public void save(Student stu) {
        StudentDao studentDao = new StudentDao();
        studentDao.insert(stu);
    }

    public void delete(String id) {
        StudentDao studentDao = new StudentDao();
        studentDao.delete(id);
    }
}
